#ifndef KERNEL_H
#define KERNEL_H

#include <QtCore/QObject>
#include <QtCore/QSettings>
#include "global.h"

namespace smsbilling {

class KernelPrivate;

class Kernel : public QObject {
  Q_OBJECT
public:
  Kernel();

  ~Kernel();

  static Kernel *instance();

  dbmanager::DatabaseManager *db();

  KernelSettings *settings() const;

  quint32 getServerId() const;

  smslog::LogLevel getLogLevel() const;

  QString getDbHost() const;

  quint16 getDbPort() const;

  QString getDbName() const;

  QString getDbUserName() const;

  QString getDbPassword() const;

  int getNumConnectDb() const;

  bool readConfig(QSettings *config);

  void start();

  void stop();

  QString getLastError() const;

signals:

  void stateChanged(State state);

private:

  friend class KernelPrivate;

  KernelPrivate *p;
};

} // namespace smsbilling

#endif // KERNEL_H
